package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.goods.StockBackService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author:boy
 * @Date:2019/7/21
 * @description:
 * @ModifiedBy:
 */
@Component
public class SkuTask {
    @Autowired
    private StockBackService stockBackService;

    private Logger logger= LoggerFactory.getLogger(SkuTask.class);
    @Scheduled(cron = "0 0 0/1 * * ?")
    public void orderTimeOutLogic(){
        logger.info("[doBack:" + new Date() + "]", "callback orderItem.....");
        stockBackService.doBack();
        logger.info("[doBack:" + new Date() + "]", "callback over.....");
    }
}
